<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- <style ></style> -->
    <link rel="stylesheet" href="form.css">
    
</head>

<body>
    <!-- import vue cdn: -->
    <script src="https://unpkg.com/vue@next"></script>

    <div id="app">
        <!-- write your vue tags or common html tages there: -->
        <!-- try:Data bidirectional binding -->
        <h1>{{msg}}</h1>
        <form @submit.prevent="post">
            <!-- use the .prevent to prevent the submit default action(when you click the submit button,the page will refresh) -->
            <!-- v-model implement the bidirectional binding
            v-model.number will restrict the type of the data.
            -->
            <!-- <input type="text" v-model.number="msg"> -->
            <!-- use v-model.lazy to invoke achieve the effect that if the focuse chaged ,the title changes only
            and you should manual refresh the page -->
            <!-- v-model.trim to trip the verbose space around the string. -->
            <input type="text" v-model.lazy="msg">
            <button>submit the form</button>
        </form>
    </div>
    <!-- write your js code: -->

    <script>
        Vue.createApp({
            /* define your variables (which will be bind to tags properties there:) */
            data() {
                return{
                    /* try:Data bidirectional binding :msg */
                    msg:":smile 💆 "
                }
            },
            /* write your methods there:(including callbacks and so on) */
            methods: {
                post() {
                    /* bind the msg */
                    console.log(this.msg);
                }
            }
        }).mount("#app")

    </script>
</body>

</html>